<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>edit.html</title>
</head>
 <body>
 <script type="text/javascript">
 	var winDataDictEdit = new Windows("win_datadict_edit");
	var ODataDictEdit = {
		initForm : function(){
		    winDataDictEdit.find("#DataDictEditForm").form({
	 			url:'$!basePath/admin/datadict/doEdit',
	 			onSubmit: function(){
			    	var pass = winDataDictEdit.find("#DataDictEditForm").form("validate");
			    	if(pass){
			    		winDataDictEdit.find("#ok").linkbutton("loading");
			    	}
			    	return pass; 
			    },
			    success:function(data){
			   		var result = jQuery.parseJSON(data);   
			        if(result.success == true){
			       		top.Notiy.success("修改成功!");
		        		winDataDictEdit.setReturnValue(true);
						winDataDictEdit.close();
			        }else{
			        	top.Dialog.alert("错误",result.error,"error");
			        }
			        winDataDictEdit.find("#ok").linkbutton("reset");
			    }
 			});
		},
		ok : function(){
			winDataDictEdit.find('#DataDictEditForm').submit();
		},
		cancel : function(){
			winDataDictEdit.close();
		}
	}
 	$(function(){
 		ODataDictEdit.initForm();
 	});
 </script>
 <div class="easyui-layout" data-options="fit:true">
	 <div data-options="region:'center',border:false">
	 	<form id="DataDictEditForm" method="post" style="padding-top:10px;padding-left:20px;">
	 		<input type="hidden" name="id" value="$!dd.id"/>
	 		<table width="90%" style="line-height: 25px;">
	 			#if($!dd.dataDictType.dataType == "MAP")
				<tr>
					<td width="20%">键：</td>
					<td><input id="name" class="easyui-validatebox" type="text" #if($!dd.dataDictType.dataType == "MAP")data-options="required:true"#end name="name" style="width:100%" value="$!dd.name"/></td>
				</tr>
				#end
				<tr>
					<td width="20%">值：</td>
					<td><input id="value" class="easyui-validatebox" type="text" data-options="required:true" name="value" style="width:100%" value="$!dd.value"/></td>
				</tr>
				#if($!dd.dataDictType.dataType != "VALUE")
				<tr>
					<td width="20%">排序：</td>
					<td><input id="location" class="easyui-numberspinner" type="text" data-options="required:true,max:$!total" name="location" style="width:100%" value="$!dd.location"/></td>
				</tr>
				#end
			</table>
		</form>
	 </div>
	 <!--Change Button Text-->
	 <div data-options="region:'south',border:false">
	 	<div class="dialog-button">
			<a id="ok" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="ODataDictEdit.ok()">确定</a>
			<a id="cancel" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="ODataDictEdit.cancel()">取消</a>
		</div>
	</div>
 </div>
  </body>
</html>
